package com.hzw.saas.web.sso.security;

import com.hzw.saas.common.security.config.customer.SaasSecurityConfig;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author sonam
 * @sine 2021/11/3 11:28 上午
 */
@Primary
@Service
@RequiredArgsConstructor
public class SsoSecurityConfig implements SaasSecurityConfig {

    @Override
    public String resourceId() {
        return "saas-user-center";
    }

    @Override
    public List<String> ignoreAuthUrls() {
        List<String> ignoreAuthUrls = new ArrayList<>();
        ignoreAuthUrls.add("/saas/oauth2/**");
        ignoreAuthUrls.add("/saas/wechat/**");
        return ignoreAuthUrls;
    }

    @Override
    public List<String> ignoreStaticUrls() {
        return Arrays.asList("/webjars/**",
            "/swagger/**",
            "/swagger-ui.html",
            "/v2/api-docs",
            "/v2/api-docs-ext",
            "/doc.html",
            "/swagger-resources/**",
            "/js/**",
            "/css/**",
            "/favicon.ico");
    }
}
